package com.py.credit.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.py.credit.common.logs.ExceptionLogger;
import com.py.credit.common.rest.RestServiceResult;
import com.py.credit.service.YzApiDateService;
import com.py.framework.core.annotation.IgnoreAuthority;

@RestController
@RequestMapping(value = "/yzApiDateController")
public class YzApiDateController {
	
	@Autowired
	private YzApiDateService yzApiDateService;
	
	@IgnoreAuthority
	 @RequestMapping(value = "/selectbeijingDate.json")
	    public RestServiceResult selectbeijingDate(
	            @RequestParam(value = "entNameOrEntCode", defaultValue = "", required = true) String entNameOrEntCode,
	            HttpServletRequest request) {
	        RestServiceResult result = new RestServiceResult<>();
	        List<Map<String,Object>> dataList=new  ArrayList<Map<String,Object>>();
	        try {
	        	yzApiDateService.insertBeijingDate(entNameOrEntCode);
	        	 result.setCode(RestServiceResult.CODE_SUCCESS);
		          result.setMsg("新增北京查询数据成功！");
	        } catch (Exception e) {
	            result.setCode(RestServiceResult.CODE_UNKNOW);
	            result.setMsg("新增北京查询数据异常异常！");
	            ExceptionLogger.error("新增北京查询数据异常异常！", e.getMessage(), e);
	            return result;
	        }
	        return result;
	    }

}
